
package jsyf.com.dao;

import jsyf.com.entity.TAttachment;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * <B>系统名称：</B>通用系统功能<BR>
 * <B>模块名称：</B>数据访问通用功能<BR>
 * <B>中文类名：</B>系统文件行映射器<BR>
 * <B>概要说明：</B><BR>
 * @author: @韩武洽 @Wyshown
 * @Version: V1.0.0
 */
public class TAttachmentRowMapper implements RowMapper<TAttachment> {

    /**
     * <B>方法名称：</B>映射行数据<BR>
     * <B>概要说明：</B><BR>
     * @author: @韩武洽 @Wyshown
     * @Version: V1.0.0
     * @param rs 结果集
     * @param row 行号
     * @return JSONObject 数据
     * @throws SQLException SQL异常错误
     * @see RowMapper#mapRow(ResultSet,
     *      int)
     */
    @Override
    public TAttachment mapRow(ResultSet rs, int row) throws SQLException {
        TAttachment att = new TAttachment();
        att.setId(rs.getString("ID"));
        att.setCreatedBy(rs.getString("CREATED_BY"));
        att.setCreatedTime(rs.getDate("CREATED_TIME"));
        att.setDataGroup(rs.getString("DATA_GROUP"));
        att.setExpiresTime(rs.getDate("EXPIRES_TIME"));
        att.setExtension(rs.getString("EXTENSION"));
        att.setFileName(rs.getString("FILE_NAME"));
        att.setFileSize(rs.getString("FILE_SIZE"));
        att.setFileType(rs.getString("FILE_TYPE"));
        att.setFileUrl(rs.getString("FILE_URL"));
        att.setDelFlag(rs.getString("DEL_FLAG"));
        att.setModifyBy(rs.getString("MODIFY_BY"));
        att.setModifyTime(rs.getDate("MODIFY_TIME"));
        return att;
    }
}